<?php 
$companyid=$session->read("companyid");
$user=$session->read('User');
?>
<div class="right_side_operate_area">
	<div class="right_side_title left">
		<h2>
			<?php 
			$companyname=$session->read("companyname");
			echo $html->link($companyname,"/companys/showinfosummary/".$companyid);
			?>
		</h2>
		<div class="clear"></div>
	</div>
   <?php 
   if(classregistry::init('User')->personAuthority($user)){
		echo '<div class="right item_add_btn">';
		echo $html->link(__("Add",true),"editachievement");
		echo '</div>';
   }
	?>
    <?php  
	if($showpage==1)
	{
		if(isset($paging)){ echo $this->renderElement('pagination',$paging);} 
	}
	?>
    <div class="clear"></div>
    <!--<div class="right_sidt_head_screen">
    	<div class="left">
		    <div class="right_side_head_line">
				<ul>
					<li style="width:300px">
						<div class="left screen_condition">总科研费用（￥）：</div>
						<div class="left screen_counts" id="sumprice">0</div>
						<div class="clear"></div>
					</li>
				</ul>
			</div>
		</div>
		<div class="right display_by_year_btn"><?php //echo $html->link('按年度显示',"/companys/timeachievements/",null,null); ?></div>
		<div class="clear"></div>
	</div>-->
</div>
<div class="right_side_scollbar">
    <div class="detail_info_panel">
        <div class="items_list">
        	<table>
            	<tr>
                	<th><?php echo '合作高校'; ?></th>
                    <th><?php echo '是否签约' ;?></th>
                    <th><?php echo '签约日期' ;?></th>
                    <th><?php echo '合同金额(￥)' ;?></th>
                    <th><?php echo '合作进度' ;?></th>
                    <th><?php __("Action")?></th>
                </tr>
                <?php 
                //$sumprice=0;
				foreach($achievements as $achievement){
					$id=$achievement["Achievement"]["id"];
					echo "<tr class='per_list'>";
					echo "<td>".$html->link($achievement["Achievement"]["universty_rely"],"/companys/showachievement/".$id)."</td>";
					$is_sign = $achievement["Achievement"]["is_rely"];
					echo "<td>".$str->getisflag($is_sign)."</td>";
					$date=$achievement['Achievement']['a_time'];
					if(!empty($date)){
						$date=date("Y-m-d",strtotime($date));
					}
					echo "<td>".$date."</td>";
					$acost=$achievement['Achievement']['cost'];
//					$sumprice+=$acost;
					echo "<td>".$acost."</td>";	
					$process=$achievement["Achievement"]["remark"];
					echo "<td>"."<span title='".$process."'>".$str->sub_len($process,15)."</span>"."</td>";
					echo "<td>";
					if(classregistry::init('User')->personAuthority($user)&&classregistry::init('Company')->personAuthority($achievement)){
						echo $html->link(__("Edit",true),"/companys/editachievement/".$id,null,null);
						echo $html->link(__("Delete",true),"/companys/delachievement/".$id,array("onclick"=>"return doaction(this)"));
					}
					echo "</td>";
					echo "</tr>";
				}?>
            </table>
            <!--<?php //if($sumprice){?>
            	<script>$("#sumprice").html("<?php //echo $sumprice?>");</script>
            <?php //}?>-->
		</div>
	</div>
</div>
<?php echo $this->element('actionconfirm',array("title"=>"删除提示","message"=>"你确定要删除吗？")) ?>